<div data-ng-controller="contractBaseCtrl">
    <div class="table-header clearfix ng-scope">
        <span class="fl lh30 f14">{{contractBaseInfo.contract_code}}</span>
    </div>

    <form name="contractBaseForm"  class="form-horizontal" novalidate>
        <div class="section-title c-orange ml10 mt10"><em class="digit-circle">1</em><span class="ml10">客户信息</span>
        </div>
        <div class="form-group mt10">
            <span class="col-sm-3 control-label">客户性质</span>

            <div class="col-sm-5">
                <div class="radio fl" style="margin-right:50px">
                    <input type="radio" ng-model="contractBaseInfo.customer_property" required value="0" id="rbt_dev" name="customer_property" checked="checked">
                    <label for="rbt_dev">开发商</label>
                </div>
                <div class="radio fl">
                    <input type="radio" ng-model="contractBaseInfo.customer_property" required value="1" id="rbt_agent" name="customer_property">
                    <label for="rbt_agent">代理商</label>
                </div>
                <span role="alert" style="clear:both;"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.customer_property.$touched) && contractBaseForm.customer_property.$error.required"
                      class="clearfix error ng-hide c-red lh30">请选择客户性质</span>
            </div>
        </div>

        <div class="form-group mt10">
            <span for="inputtext3" class="col-sm-3 control-label">客户简称</span>

            <div class="col-sm-5">
                <input id="idCustomerName" name="customer_id" select2 required ng-model="contractBaseInfo.customer_id" select2-model="ddl2Customer"
                       config="ddlConfigCustomer" class="form-control" type="text"/>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.customer_id.$touched) && contractBaseForm.customer_id.$error.required"
                      class="error ng-hide c-red lh30">客户简称不能为空</span>
            </div>
            <span for="inputtext3" class="col-sm-3 control-label">顶级客户简称</span>

            <div class="col-sm-5">
                <input type="text" ng-model="contractBaseInfo.top_customer_name" class="form-control" id="inputtext3" ng-disabled="true" placeholder="顶级客户简称">
            </div>
            <span for="inputtext3" class="col-sm-3 control-label">签约客户全称</span>

            <div class="col-sm-5">
                <input type="text"  ng-model="contractBaseInfo.customer_full_name" class="form-control" id="inputtext3" ng-disabled="true" placeholder="签约客户简称">
            </div>
            <div class="col-sm-23 relative pb10 ml25 pull-right mr10">
                <div class="border-bottom-dashed pl10 relative"></div>
            </div>

        </div>

        <!-- 合同信息 -->
        <div class="section-title c-orange ml10 mt10"><em class="digit-circle">2</em><span class="ml10">合同信息</span>
        </div>
        <div class="form-group mt10">
            <span for="inputtext3" class="col-sm-3 control-label">合同性质</span>

            <div class="col-sm-5">
                <input select2 required name="contract_property_id" ng-model="contractBaseInfo.contract_property_id" select2-model="ddl2Nature"
                       config="ddlConfigContractNature" class="form-control" type="text"/>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.contract_property_id.$touched) && contractBaseForm.contract_property_id.$error.required"
                      class="error ng-hide c-red lh30">请选择合同性质</span>
            </div>
            <span for="inputtext3" class="col-sm-3 control-label">合同签署公司</span>

            <div class="col-sm-5">
                <input id="idCompanyId" select2 required name="company_id" ng-model="contractBaseInfo.company_id" select2-model="ddl2Company" config="ddlConfigCompany"
                       class="form-control" type="text"/>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.company_id.$touched) && contractBaseForm.company_id.$error.required"
                      class="error ng-hide c-red lh30">请选择合同签署公司</span>
            </div>
            <span for="inputtext3" class="col-sm-3 control-label">合同编号</span>

            <div class="col-sm-5">
                <input type="text" required maxlength="200" name="contract_code" ng-model="contractBaseInfo.contract_code" class="form-control" id="inputtext3"
                       placeholder="合同编号" ng-disabled="true">
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.contract_code.$touched) && contractBaseForm.contract_code.$error.required"
                      class="error ng-hide c-red lh30">合同编号不能为空</span>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.contract_code.$touched) && contractBaseForm.contract_code.$error.maxlength"
                      class="error ng-hide c-red lh30">合同编号不能超过200个字符</span>
            </div>
        </div>
        <div class="form-group mt10">
            <span for="inputtext3" class="col-sm-3 control-label">合同类别</span>

            <div class="col-sm-5">
                <input select2 required name="category_id" ng-model="contractBaseInfo.category_id" select2-model="ddl2Category"
                       config="ddlConfigContractCategory" class="form-control" type="text"/>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.category_id.$touched) && contractBaseForm.category_id.$error.required"
                      class="error ng-hide c-red lh30">请选择合同类别</span>
            </div>
            <span for="inputtext3" class="col-sm-3 control-label">合同大类</span>

            <div class="col-sm-5">
                <input select2 required name="big_category_id" ng-model="contractBaseInfo.big_category_id" select2-model="ddl2BigClass"
                       config="ddlConfigContractBigClass" class="form-control" type="text"/>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.big_category_id.$touched) && contractBaseForm.big_category_id.$error.required"
                      class="error ng-hide c-red lh30">请选择合同大类</span>
            </div>
            <span for="inputtext3" class="col-sm-3 control-label">合同小类</span>

            <div class="col-sm-5">
                <input id="idSmallClass" select2 name="littler_category_id" ng-model="contractBaseInfo.littler_category_id" select2-model="ddl2SmallClass"
                       config="ddlConfigContractSmallClass" class="form-control" type="text"/>
            </div>
        </div>
        <div class="form-group mt10">
            <span for="inputtext3" class="col-sm-3 control-label">合同签署日期</span>

            <div class="col-sm-5">
                <input type="text" class="input-date fl form-control" style="width:100%"
                       ui-date format="yyyy-MM-dd" required name="sign_date" ng-model="contractBaseInfo.sign_date" placeholder="合同签署日期"
                       >
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.sign_date.$touched) && contractBaseForm.sign_date.$error.required"
                      class="error ng-hide c-red lh30">合同签署日期不能为空</span>
            </div>
            <span for="inputtext3" class="col-sm-3 control-label">合同录入日期</span>

            <div class="col-sm-5">
                <input type="text" class="input-date fl form-control" style="width:100%"
                       ui-date format="yyyy-MM-dd" ng-model="contractBaseInfo.input_date" placeholder="保存后自动生成" ng-disabled="true">
            </div>

            <div class="col-sm-23 relative pb10 ml25 pull-right mr10">
                <div class="border-bottom-dashed pl10 relative"></div>
            </div>

        </div>
        <div class="form-group mt10">
            <span for="inputtext3" class="col-sm-3 control-label">合同签约人</span>

            <div class="col-sm-5">
                <input id="idSigner" select2 required name="sign_people_id" ng-model="contractBaseInfo.sign_people_id" select2-model="ddl2Signer"
                       config="ddlConfigContractSigner" class="form-control" type="text" placeholder="合同签约人"/>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.sign_people_id.$touched) && contractBaseForm.sign_people_id.$error.required"
                      class="error ng-hide c-red lh30">请选择合同签约人</span>
            </div>
            <span for="inputtext3" class="col-sm-3 control-label">合同所属区域</span>

            <div class="col-sm-5">
                <input type="text" name="area_name" ng-model="contractBaseInfo.area_name" class="form-control" id="inputtext3" ng-disabled="true" placeholder="合同所属区域">
            </div>
        </div>
        <div class="form-group mt10">
            <span for="inputtext3" class="col-sm-3 control-label">签约金额</span>

            <div class="col-sm-5">
                <input type="number" name="sign_amount" number required min="0" ng-model="contractBaseInfo.sign_amount" class="form-control align-r" id="inputtext3" placeholder="签约金额">
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.sign_amount.$touched) && contractBaseForm.sign_amount.$error.required"
                      class="error ng-hide c-red lh30">签约金额不能为空</span>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.sign_amount.$touched) && contractBaseForm.sign_amount.$error.number"
                      class="error ng-hide c-red lh30">签约金额必须是数值类型</span>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.sign_amount.$touched) && contractBaseForm.sign_amount.$error.min"
                      class="error ng-hide c-red lh30">签约金额必须大于等于0</span>
            </div>
            <span for="inputtext3" class="col-sm-3 control-label">产品租用金额</span>

            <div class="col-sm-5">
                <input type="number" number required min="0" name="rent_amount" ng-model="contractBaseInfo.rent_amount" class="form-control align-r" id="inputtext3" placeholder="产品租用金额">
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.rent_amount.$touched) && contractBaseForm.rent_amount.$error.required"
                      class="error ng-hide c-red lh30">产品租用金额不能为空</span>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.rent_amount.$touched) && contractBaseForm.rent_amount.$error.number"
                      class="error ng-hide c-red lh30">产品租用金额必须是数值类型</span>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.rent_amount.$touched) && contractBaseForm.rent_amount.$error.min"
                      class="error ng-hide c-red lh30">产品租用金额必须大于等于0</span>
            </div>
            <span for="inputtext3" class="col-sm-3 control-label">交付金额</span>

            <div class="col-sm-5">
                <input type="number" number required min="0" name="delivery_amount" ng-model="contractBaseInfo.delivery_amount" class="form-control align-r" id="inputtext3" placeholder="交付金额">
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.delivery_amount.$touched) && contractBaseForm.delivery_amount.$error.required"
                      class="error ng-hide c-red lh30">交付金额不能为空</span>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.delivery_amount.$touched) && contractBaseForm.delivery_amount.$error.number"
                      class="error ng-hide c-red lh30">交付金额必须是数值类型</span>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.delivery_amount.$touched) && contractBaseForm.delivery_amount.$error.min"
                      class="error ng-hide c-red lh30">交付金额必须大于等于0</span>
            </div>
            <div class="col-sm-23 relative pb10 ml25 pull-right mr10">
                <div class="border-bottom-dashed pl10 relative"></div>
            </div>

        </div>
        <!-- 项目列表 -->
        <div ng-include="'editinc/base-inc-projects.html'"></div>

        <div class="form-group mt20">
            <span for="inputtext4" class="col-sm-4 control-label">额定实施工作量(人/天)</span>

            <div class="col-sm-4">
                <input type="number" name="implement_work_day" number min="0" ng-model="contractBaseInfo.implement_work_day"
                       class="form-control align-r" id="inputtext3" placeholder="额定实施工作量">
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.implement_work_day.$touched) && contractBaseForm.implement_work_day.$error.number"
                      class="error ng-hide c-red lh30">额定实施工作量必须是数值类型</span>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.implement_work_day.$touched) && contractBaseForm.implement_work_day.$error.min"
                      class="error ng-hide c-red lh30">额定实施工作量必须大于等于0</span>
            </div>
            <span for="inputtext4" class="col-sm-4 control-label">额定开发工作量(人/天)</span>

            <div class="col-sm-4">
                <input type="number" number min="0" name="develop_work_day" ng-model="contractBaseInfo.develop_work_day"
                       class="form-control align-r" id="inputtext3" placeholder="额定开发工作量">

                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.develop_work_day.$touched) && contractBaseForm.develop_work_day.$error.number"
                      class="error ng-hide c-red lh30">额定开发工作量必须是数值类型</span>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.develop_work_day.$touched) && contractBaseForm.develop_work_day.$error.min"
                      class="error ng-hide c-red lh30">额定开发工作量必须大于等于0</span>
            </div>
            <span for="inputtext3" class="col-sm-4 control-label">赠送工作量(人/天)</span>

            <div class="col-sm-4">
                <input type="number" number min="0" name="give_work_day" ng-model="contractBaseInfo.give_work_day"
                       class="form-control align-r" id="inputtext3" placeholder="赠送工作量">
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.give_work_day.$touched) && contractBaseForm.give_work_day.$error.number"
                      class="error ng-hide c-red lh30">赠送工作量必须是数值类型</span>
                <span role="alert"
                      ng-show="(contractBaseForm.$submitted || contractBaseForm.give_work_day.$touched) && contractBaseForm.give_work_day.$error.min"
                      class="error ng-hide c-red lh30">赠送工作量必须大于等于0</span>
            </div>

        <div class="form-group mt35 clearfix clearboth" ng-if="contractBaseInfo.contract_status == 0 && contractBaseInfo.is_cancelled == 0">
            <div class="ml35 mt15">
                <button type="submit" ng-click="contractBaseForm.$valid && save()" class="btn btn-default">保存</button>
            </div>
        </div>
    </form>
</div>